/**
 * This file is part of Idegen, the application to create IDE project files.
 *
 * @copyright Copyright (c) 2011-2012, Walter Tamboer http://waltertamboer.nl
 * @file Idegen/Generator/VS2010Generator.hpp
 */

#ifndef IDEGEN_GENERATOR_VS2010GENERATOR_HPP
#define IDEGEN_GENERATOR_VS2010GENERATOR_HPP

namespace Idegen
{
	class IdegenProjectConfig;
	class Settings;
	class VisualStudioGenerator;

	/** The Visual Studio 2010 generator. */
	class VS2010Generator: public VisualStudioGenerator
	{
	public:
		/** Initializes a new instance of this class. */
		VS2010Generator();

	protected:
		/**
		 * Generates the project for this generator.
		 *
		 * @param[in] settings The settings used to parse.
		 * @param[in] project The project to create.
		 */
		virtual void GenerateProject( Settings* settings, IdegenProject* project );

		/**
		 * Generates the solution file for this generator.
		 *
		 * @param[in] settings The settings used to parse.
		 * @param[in] generator The generator to create the solution for.
		 */
		virtual void GenerateSolution( Settings* settings, IdegenGenerator* generator );
		
		/**
		 * Generates the project filters for this generator.
		 *
		 * @param[in] project The project to create.
		 */
		void GenerateProjectFilters( IdegenProject* project );

		void GenerateProjectFiles( TiXmlElement* parent, IdegenProject* project );
		void GenerateProjectFilterItems( TiXmlElement* parent, IdegenProject* project );

		void WriteDefinitions( TiXmlElement* element, IdegenProject* project, const IdegenProjectConfig* config );
		void WriteIncludeDirectories( TiXmlElement* element, Settings* settings, const IdegenProjectConfig* config );
		void WriteLibraryDirectories( TiXmlElement* element, Settings* settings, const IdegenProjectConfig* config );

		/**
		 * Writes the project configuration.
		 *
		 * @param[in] config The configuration.
		 * @param[in] platform The platform.
		 * @return Returns the element.
		 */
		TiXmlElement* WriteProjectConfiguration( const std::string& config, const std::string& platform );

		/**
		 * Writes a project filter.
		 *
		 * @param[in] parent The parent element.
		 * @param[in] filter The filter to write.
		 */
		void WriteProjectFilter( TiXmlElement* parent, IdegenProjectFilter* filter );

		/**
		 * Writes the version of the solution we are creating.
		 *
		 * @param[in] os The output stream of the file.
		 */
		void WriteSolutionVersion( std::wostream& os );
	};
}

#endif
